package com.fingersoft.feature.ebensign;

import android.app.Activity;
import android.app.Application;

import androidx.annotation.Nullable;

import org.greenrobot.eventbus.EventBus;
import org.jetbrains.annotations.NotNull;

import cn.fingersoft.eben.IEBenSignConfig;
import cn.fingersoft.signpad.Events;
import cn.fingersoft.signpad.IActivitySignPadBehavior;

public class SealEbenSignContext implements IEBenSignConfig {
//    private final Application application;
//
//    public SealEbenSignContext(Application application) {
//
//        this.application = application;
//    }

    @Override
    public void saveSign(@NotNull Activity activity, @NotNull String path, @Nullable IActivitySignPadBehavior behavior) {
        if (behavior != null) {
            behavior.onSave(activity, 22, path);
        } else {
            EventBus.getDefault().post(new Events.SaveEvent(22, path));
            activity.finish();
        }
    }
}
